//
//  UIBarButtonItem+DKExtension.m
//  BSBDJ
//
//  Created by 丁侃 on 16/4/23.
//  Copyright © 2016年 丁侃. All rights reserved.
//

#import "UIBarButtonItem+DKExtension.h"

@implementation UIBarButtonItem (DKExtension)

+(instancetype) itemWithTargrt:(id) target action:(SEL)action imageName:(NSString *)imageName highlightImageName:(NSString *)highlightImageName
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:highlightImageName] forState:UIControlStateHighlighted];
    [btn sizeToFit];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return [[UIBarButtonItem alloc]initWithCustomView:btn];
}

@end
